package com.example.coffeejava.Controller;

import com.example.coffeejava.Dto.Result;
import com.example.coffeejava.Entity.Shop;
import com.example.coffeejava.Service.ShopService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/shop")
public class ShopController {
    @Resource
    private ShopService shopService;
    @GetMapping("/list")
    public Result list(){
        List<Shop> shops=shopService.list();
        return Result.ok(shops);
    }
    @GetMapping("/count")
    public Result count(){
        return shopService.getcount();
    }
    @GetMapping("/chart")
    public Result chart(){
        return shopService.chart();
    }
    @GetMapping("/chart2")
    public Result chart2(){
        return shopService.chart2();
    }
}
